package com.cc.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    public static Date StringToDate(String datetime){
        String format = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        Date date = null;
        try {
            //将字符串转换成日期格式
            date = sdf.parse(datetime);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}
